package com.qf.gitadmin.manager.controller;

import com.qf.entity.Manager;
import com.qf.gitadmin.manager.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author XueSong
 * @Date 10/08
 * @Desc
 */
@RestController
//@RequestMapping("/gitadmin")
public class ManagerController {
    @Resource
    ManagerService managerService;
    @GetMapping("/managePage")
    public List<Manager> managePage(){
        List<Manager> managers = managerService.selectAll();
        return managers;
    }

    @PostMapping("/add")
    public int addManager(Manager manager){
        int i = managerService.insertManager(manager);
        return i;
    }
}
